package com.finalBlog.validator;

import com.finalBlog.common.Dic;
import com.finalBlog.common.JsonMsg;
import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * finalBlog
 *	
 * 类/接口信息描述:render json 格式的信息
 *
 * @author dengxc
 *
 */
public abstract class JsonRenderValidator extends Validator {
	@Override
	protected void handleError(Controller c) {
		JsonMsg msg = new JsonMsg();
		msg.setMsg(c.getAttr(Dic.jsonMsg)==null?"":c.getAttr(Dic.jsonMsg).toString());
		msg.setSuccess(false);
		msg.setNum(0);
		c.renderJson(msg);
		return;
	}

}
